package com.rylan.feign;

import com.rylan.entity.Room;
import com.rylan.entity.Type;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author rylan
 * @description
 */
@FeignClient(value = "roomserver")
public interface RoomFeign {
    @GetMapping("/room/findAll/{index}/{limit}")
    public List<Room> findAll(@PathVariable("index")int index,@PathVariable("limit") int limit);

    @DeleteMapping("/room/deleteById/{id}")
    public void deleteById(@PathVariable("id") long id);

    @GetMapping("/room/findTypes")
    public List<Type> findTypes();

    @PostMapping("/room/save")
    public void save(Room room);

    @GetMapping("room/findById/{id}")
    public Room findById(@PathVariable("id") long id);

    @PutMapping("/room/update")
    public void update(Room room);
}
